package com.zreal.generator.codegenerate.database;

/**
 * column properties
 * @author pj
 * @since 2013-04-09
 */
public class Column {

    /**
     * 表名
     */
    private String tableName;

    /**
     * 数据库字段名
     */
    private String fieldDbName;
    /**
     * 对象属性名
     */
    private String fieldName;
    /**
     * 字段说明
     */
    private String filedComment;
    /**
     * 属性类型
     */
    private String fieldType;
    /**
     * 数据库字段类型
     */
    private String fieldDBType;
    private String classType;
    private String classType_row;
    private String optionType;
    private String charmaxLength;
    private String precision;
    private String scale;
    private String nullable;
    private boolean primaryKey; //是否主键

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getFieldDbName() {
        return fieldDbName;
    }

    public void setFieldDbName(String fieldDbName) {
        this.fieldDbName = fieldDbName;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getFiledComment() {
        return filedComment == null ? "" : filedComment;
    }

    public void setFiledComment(String filedComment) {
        this.filedComment = filedComment;
    }

    public String getFieldType() {
        return fieldType;
    }

    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }

    public String getClassType() {
        return classType;
    }

    public void setClassType(String classType) {
        this.classType = classType;
    }

    public String getClassType_row() {
        return classType_row;
    }

    public void setClassType_row(String classType_row) {
        this.classType_row = classType_row;
    }

    public String getOptionType() {
        return optionType;
    }

    public void setOptionType(String optionType) {
        this.optionType = optionType;
    }

    public String getCharmaxLength() {
        return charmaxLength;
    }

    public void setCharmaxLength(String charmaxLength) {
        this.charmaxLength = charmaxLength;
    }

    public String getPrecision() {
        return precision;
    }

    public void setPrecision(String precision) {
        this.precision = precision;
    }

    public String getScale() {
        return scale;
    }

    public void setScale(String scale) {
        this.scale = scale;
    }

    public String getNullable() {
        return nullable;
    }

    public void setNullable(String nullable) {
        this.nullable = nullable;
    }

    public String getFieldDBType() {
        return fieldDBType;
    }

    public void setFieldDBType(String fieldDBType) {
        this.fieldDBType = fieldDBType;
    }

    public boolean isPrimaryKey() {
        return primaryKey;
    }

    public void setPrimaryKey(boolean primaryKey) {
        this.primaryKey = primaryKey;
    }

    @Override
    public String toString() {
        return "Column{" +
                "tableName='" + tableName + '\'' +
                ", fieldDbName='" + fieldDbName + '\'' +
                ", fieldName='" + fieldName + '\'' +
                ", filedComment='" + filedComment + '\'' +
                ", fieldType='" + fieldType + '\'' +
                ", fieldDBType='" + fieldDBType + '\'' +
                ", classType='" + classType + '\'' +
                ", classType_row='" + classType_row + '\'' +
                ", optionType='" + optionType + '\'' +
                ", charmaxLength='" + charmaxLength + '\'' +
                ", precision='" + precision + '\'' +
                ", scale='" + scale + '\'' +
                ", nullable='" + nullable + '\'' +
                ", primaryKey=" + primaryKey +
                '}';
    }
}
